extends Control

@onready var infoLabel: Label = $Info/Label
@onready var magicLabel: Label = $Magic/Label
@onready var itemLabel: Label = $Item/Label
@onready var attrLabel: Label = $Attr/Label
@onready var headTexture: TextureRect = $Head/TextureRect


func _ready() -> void:
	hide()


func init(data):
	infoLabel.text = infoLabel.text.replace("{charName}", data.id)
	infoLabel.text = infoLabel.text.replace("{careerName}", data.careerConfig.id)
	infoLabel.text = infoLabel.text.replace("{level}", str(data.level))
	infoLabel.text = infoLabel.text.replace("{exp}", str(data.exp))
	infoLabel.text = infoLabel.text.replace("{weaponType}", data.weaponTypeConfig.name)
	infoLabel.text = infoLabel.text.replace("{hp}", str(data.battleHp))
	infoLabel.text = infoLabel.text.replace("{maxHp}", str(data.hp))
	attrLabel.text = attrLabel.text.replace("{attack}", str(data.attack))
	attrLabel.text = attrLabel.text.replace("{skill}", str(data.skill))
	attrLabel.text = attrLabel.text.replace("{speed}", str(data.speed))
	attrLabel.text = attrLabel.text.replace("{luck}", str(data.luck))
	attrLabel.text = attrLabel.text.replace("{defense}", str(data.defense))
	attrLabel.text = attrLabel.text.replace("{magicDefense}", str(data.magicDefense))
	attrLabel.text = attrLabel.text.replace("{move}", str(data.move))
	attrLabel.text = attrLabel.text.replace("{exp}", str(data.exp))
	
	
